<!--
 * @Author: zqx me_zqx@163.com
 * @Date: 2025-02-08 11:32:29
 * @LastEditors: zqx me_zqx@163.com
 * @LastEditTime: 2025-02-25 17:57:11
 * @FilePath: /XMate-h5/src/views/customer/customerDetail/components/companyInfo/index.vue
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
-->
<template>
  <div class="company-containter">
    <iframe class="web-view" :key="key" :src="webUrl"></iframe>
  </div>
</template>

<script setup>
import { onMounted, ref, computed } from "vue";
import { useCustomerStore, useCommonStore } from "@/store";
import { getToken } from "@/utils/auth";

const commonStore = useCommonStore()
const store = useCustomerStore();
const webUrl = ref("");
const key = ref(new Date().getTime());

onMounted(() => {
  let env = import.meta.env.VITE_ENV;
  let baseUrl = "";
  if (env === "production" || env === "blue") {
    baseUrl = "https://x-mate.com";
  } else {
    baseUrl = "https://test.x-mate.com";
  }
  const companyName = store.companyName;
  const companyId = store.currentCompanyId;
  const token = getToken();
  webUrl.value = `${baseUrl}/postmeet-xmate-h5/#/xmateCustomerDetail?companyName=${companyName}&companyId=${companyId}&token=${token}`;
});

const cp_showComponeyInfo = computed(() => {
  return commonStore.salesCompanyInCustomer;
});

</script>

<style lang="less" scoped>
.company-containter {
  display: flex;
  width: 100%;
  height: 90vh;
}

.web-view {
  flex: 1;
}

.active-item {
  color: #436dff;
  background-color: #ecf0ff;
}

/deep/ .customer-detail-container {
  padding: 10px !important;
}
</style>
